﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace CSharp.Libs.Misc
{
    public class DataLogItem
    {
        private string _strLogTime = "";
        private string _strLevel = "";
        private string _strCategory = "";
        private string _strTags = "";
        private string _strMessage = "";

        public string Message { get { return _strMessage; } set { _strMessage = value; } }

        public string Tags { get { return _strTags; } set { _strTags = value; } }

        public string Category { get { return _strCategory; } set { _strCategory = value; } }

        public string Level { get { return _strLevel; } set { _strLevel = value; } }

        public string LogTime { get { return _strLogTime; } set { _strLogTime = value; } }

        
        public override string ToString()
        {
            return _returnToString(",");
        }
        public string ToString(
            string strDelimiter)
        {
            return _returnToString(strDelimiter);
        }

        private string _returnToString(
            string strDelimiter) 
        {
            return string.Concat(
                "\"", _strLogTime, "\"",
                strDelimiter,
                "\"", _strLevel, "\"", 
                strDelimiter,
                "\"", _strCategory, "\"", 
                strDelimiter,
                "\"", _strTags, "\"", 
                strDelimiter,
                "\"", _strMessage, "\"");
        }
    }
}
